<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://java.sun.com/jsf/core"
                template="/template_content_admin.xhtml">
    
<ui:define name="conteudo">
    <h2>#{msg['adicionar_ingrediente']}</h2>
    <h:panelGroup id="messagePanel" layout="block">
            <h:messages errorClass="messagesErro" infoClass="messagesInfo" layout="table"/>
    </h:panelGroup>
    <h:form>
       <h:panelGrid columns="2" columnClasses="panelgridClass1, panelgridClass2">
            <f:facet name="header">
                <h:outputText value="Ingredientes da melhor qualidade :)"/>
            </f:facet>
            <h:outputText value="#{msg['nome']}:"/>
            <h:inputText id="nome" value="#{ingrediente.ingrediente.nome}" styleClass="try" title="Nome" required="true" requiredMessage="O nome do ingrediente é obrigatório." />
            <h:outputText value="#{msg['qtde']}:"/>
            <h:inputText id="qtde" value="#{ingrediente.ingrediente.qtde}" title="Qtde" styleClass="try"/>
            <h:outputText value="#{msg['unidade_medida']}:"/>
            <h:inputText id="unidadeMedida" value="#{ingrediente.ingrediente.unidadeMedida}" styleClass="try" title="UnidadeMedida" required="true" requiredMessage="A unidade de medida é obrigatória." />
        </h:panelGrid>
        <h:panelGrid columns="2">
            <h:commandButton id="add" styleClass="buttonK" value="#{msg['adicionar']}" action="#{ingrediente.create}" />
            <h:commandButton id="list" styleClass="buttonK" value="#{msg['listar']}" action="#{ingrediente.listarIngredientes}" immediate="true"/>
        </h:panelGrid>
        <br />
    </h:form>
</ui:define>

</ui:composition>
